home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_intro.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  180 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHS_Intro.cog
  4. #
  5. #    [JWC]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     user0
  15.     message        pulse
  16.  
  17.     template     particle
  18.  
  19.     thing        player                    local
  20.        thing       intro_indy
  21.     
  22.     thing       cam1
  23.     thing        cam1_target1
  24.     thing       cam1_target2
  25.     thing        cam2
  26.     thing        cam2_target1
  27.     thing        fader
  28.  
  29.     thing        door0
  30.     thing        door1
  31.     thing        snowobj0
  32.     thing        snowobj1
  33.  
  34.     sound        music0=mus_shs_intro.wav        local
  35.     sound       doormove=shs_door_double.wav    local
  36.     sound       doorstop=shs_door_double_stop.wav    local
  37.     
  38.     int            bSeen=0                    local
  39.  
  40.     vector        camVec                    local
  41.  
  42. end
  43.  
  44. # ========================================================================================
  45.  
  46. code
  47.  
  48. startup:
  49.     
  50.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  51.  
  52.     Sleep(0.001); # Let engine get set up
  53.  
  54.     # Start on black...
  55.     SetCameraFocus(2, cam1);
  56.     SetCameraSecondaryFocus(2, cam1_target1);
  57.     SetCameraPosInterp(2, 0);
  58.     SetCameraLookInterp(2, 0);
  59.     SetCurrentCamera(2);
  60.     SetCameraFOV(94, 0, 0.0);
  61.  
  62.     return;
  63.  
  64. # ..............................................................................
  65.  
  66. user0: # RT: Indicates that autosave/restore has completed...
  67.  
  68.     if (bSeen) return; # RT
  69.     bSeen = 1;
  70.  
  71. #   if you're going to switch the camera to start your level cutscene, do it first before anything else!
  72.     SetCameraFocus(2, cam1);
  73.     SetCameraSecondaryFocus(2, cam1_target1);
  74.     SetCameraPosInterp(2, 0);
  75.     SetCameraLookInterp(2, 0);
  76.     SetCurrentCamera(2);
  77.     SetCameraFOV(94, 0, 0.0);
  78.  
  79. #   cutscene camera is set up and set as current, now sleep for 0.01 to let the engine generate a frame
  80.     sleep(0.01);
  81.  
  82. #    then you can do the rest of the stuff you need to start your cutscene.
  83. #   IMPORTANT! -- don't do a StartCutscene() until after the new camera is set and has had a chance
  84. #   to render a frame! 
  85.  
  86.     player = GetLocalPlayerThing();
  87.     StartCutscene(2);
  88.     
  89.     # Have Doors Open
  90.     Rotate(door0, -90, 1, 1.0);
  91.     Rotate(door1, 90, 1, 1.0);
  92.     SetCollideType(door0, 0);        
  93.     SetCollideType(door1, 0);
  94.     
  95.     # Show Indy
  96.     SetThingFlags(player, 0x80000);            # hide him
  97.     SetActorFlags(player, 0x200000);        # paralyze him
  98.     ClearThingFlags(intro_indy, 0x80000);    # reveal our actor
  99.  
  100.     # Make it snow
  101.     Setpulse(.5);
  102.  
  103.     # Fade In
  104.     ThingFadeAnim(fader, 1, 0, 2.0, 0);
  105.  
  106.     # Music
  107.     PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  108.  
  109.     # Hold on aerial shot of monastery
  110.     Sleep(2.0);
  111.     DestroyThing(fader);                # possible bug fix
  112.     Sleep(2.0);
  113.  
  114.     # Pan down to door
  115.  
  116.     SetCameraLookInterp(2, 1);            # enable pan & tilt to lock on 2nd target
  117.     SetCameraPosInterp(2, 1);            # enable dolly mode 
  118.     SetCameraInterpSpeed(2, 3.75);        # slow down    pan
  119.     Sleep(.01);
  120.     SetCameraSecondaryFocus(2, cam1_target2);    # look at door
  121.     SetCameraFOV(70, 1, 3.75);
  122.     Sleep(1.8);                            # amount of time before see Indy
  123.  
  124.     # Indy walks into shot
  125.     AISetMoveSpeed(intro_indy, 1.0);
  126.     AISetMoveThing(intro_indy, player, 0);
  127.     Sleep(2.0);                         # amount of time to finish camera move
  128.  
  129.     # Move camera towards Indy
  130.     SetCameraInterpSpeed(2, 7.5);        # slow down    pan
  131.     Sleep(0.01);
  132.     SetCameraFocus(2, cam2);                    # switch cameras
  133.     SetCameraSecondaryFocus(2, cam2_target1);    # look at door
  134.     SetCameraFOV(90, 1, 7.5);
  135.  
  136.     # Doors start to close
  137.     Sleep(4.0);                          # allow indy to get past door
  138.     rotate(door0, 90, 1, 4.0);
  139.     rotate(door1, -90, 1, 4.0);
  140.     
  141.     PlaySoundLocal(doormove, 1.0, 0.0, 0x0, 0);
  142.  
  143.     # Stop Snow
  144.     SetPulse(0);
  145.  
  146.     WaitforStop(door0);
  147.     PlaySoundLocal(doorstop, 1.0, 0.0, 0x0, 0);
  148.     SetCollideType(door0, 3);        
  149.     SetCollideType(door1, 3);
  150.     sleep(1);
  151.    
  152.     # Return Control
  153.     SetThingFlags(intro_indy, 0x80000);    # make actor invisible
  154.     ClearThingFlags(player, 0x80000);    # bring player back
  155.     ClearActorFlags(player, 0x200000);
  156.  
  157.     ResetCameraFOV(0, 0.0);
  158.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  159.     SetCameraPosInterp(2, 0); # kill dolly mode
  160.     Sleep(0.01);
  161.     camVec = VectorTransformToOrient(player, '-0.25 -0.1 0.0'); # from the left side of indy
  162.     camVec = VectorAdd(camVec, GetThingPos(player));
  163.     SetCameraPosition(1, camVec);     
  164.     SetCurrentCamera(1);
  165.     EndCutscene();
  166.     
  167.     return;
  168.  
  169. # ..............................................................................
  170.  
  171. pulse:
  172.     
  173.     CreateThing(particle, snowobj0);
  174.     CreateThing(particle, snowobj1);
  175.     return;
  176.   
  177. end
  178.  
  179.  
  180.